package com.example.springboot_15_redis_cache.controller;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.RequestMapping;

public class ProductCategoryController {

//  商品分类
//  @Cacheable(value="listCache")
//  @RequestMapping("list")
//  public String list()
//  {
//      System.out.println("list() 调用Service");
//      String categories = "办公用品,男鞋,女鞋";
//      return categories;
//  }


    @RequestMapping("/hello")
    @Cacheable(value="helloCache")
    public String hello(String name) {
        System.out.println("没有走缓存！");
        return "hello "+name;
    }
}
